#pragma once
#include "stdint.h"
#include "../third/portaudio/portaudio.h"
#include "AACDecoder.h"

class AudioPlayer :public  AACDecoder::AACDecoderObserver{
public:
	class AudioPlayerObserver{
	public:
		virtual int OnAudioPlay();
	};
	typedef struct {
		int index;
		wstring name;
	}SpeakerInfo;
	enum PLAY_STATUS {
		RUNNING = 1,
		STOP = 2,
		PAUSE = 3,
		FAIL = 4,
	};
	AudioPlayer(int index);
	vector<SpeakerInfo> EnumSpeakers();
	int Play(uint8_t *data,uint16_t num);
	int OnAudioDecode(uint8_t *dat, uint16_t size);
private:
	PLAY_STATUS mStatus;
	PaStreamParameters mOutputParameters;
	PaStream *mOutStream;

};